using System;
using System.Collections.Generic;
using System.Text;
using SystemFunctionLib.Apis;

namespace SystemFunctionLib.Multimedia
{
    public static class Sound
    {
        public static void Play(string fileName, bool loop)
        {
            try
            {
                if (loop)
                {
                    WinApis.sndPlaySound(fileName, WinApis.SND_ASYNC | WinApis.SND_LOOP);
                }
                else
                {
                    WinApis.sndPlaySound(fileName, WinApis.SND_ASYNC);
                }
            }
            catch (Exception)
            {

            }
        }

        public static void Stop()
        {
            WinApis.sndPlaySound("", WinApis.SND_STOP);
        }
    }
}
